package utils

import (
    "github.com/beego/beego/v2/server/web"
)

type Config struct {
    SPDK struct {
        URL      string
        Username string
        Password string
        Timeout  int
    }
    Etcd struct {
        Endpoints []string
        Username  string
        Password  string
    }
}

var GlobalConfig Config

func InitConfig() error {
    // SPDK配置
    spdkURL, err := web.AppConfig.String("spdk::url")
    if err != nil {
        return err
    }
    GlobalConfig.SPDK.URL = spdkURL
    
    // ...其他配置项初始化...
    
    return nil
}
